From: Keir Fraser Date: Fri, 14 Jan 2011 08:08:37 +0000 (+0000) Subject: vt-d: Fix crash issue when not sharing EPT and VT-d tables. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~10918^2~16 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=a8cc5c12fbdb6206e695fcf021626a5677523b00;p=xen.git vt-d: Fix crash issue when not sharing EPT and VT-d tables. Signed-off-by: Allen Kay --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index b04203dcc7..dee64ff510 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1773,9 +1773,13 @@ void iommu_set_pgd(struct domain *d) ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled ); iommu_hap_pt_share = vtd_ept_share(); + if ( !iommu_hap_pt_share ) + goto out; + pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d))); hd->pgd_maddr = pagetable_get_paddr(pagetable_from_mfn(pgd_mfn)); +out: dprintk(XENLOG_INFO VTDPREFIX, "VT-d page table %s with EPT table\n", iommu_hap_pt_share ? "shares" : "not sharing");